package com.hk.rabbitmq.consumer;

import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author: dpb
 * @date: 2022/3/27
 */
@Slf4j
//@Component
public class DeadLetterQueueConsumer {

    public static final String ROUTINGKEY = "QD";
    public static final String DELAYED_QUEUE_NAME = "delayed.queue";

//    @RabbitListener(queues = DELAYED_QUEUE_NAME)
    public void receiveD(Message message, Channel channel) throws Exception{
        String msg = new String(message.getBody());
        log.info("当时时间：{},收到死信队列消息：{}",new Date().toString(),msg);
    }
}
